<?php
include_once 'databaseconnection.php';

$email = $_POST['email'];
$password = $_POST['password'];


	if($email=="")
	{
		header("Location:login.php?err=Please enter user email");
	}
	else if($password=="")
	{
		header("Location:login.php?err=Please enter password");
	}
	else
	{

	 if(auth($email,  md5($password))){
		session_start();
		$_SESSION['email'] = $email;
		$_SESSION['password'] = $password;
    
		header("Location:home2.php");
	}	else{
   
		header("Location:login.php?err=Your email or password incorrect!");
	}
}

?>
